package com.kingsalert.kingsalert.analytics.data_sdk.services;

import android.content.Context;

import com.google.gson.Gson;
import com.kingsalert.kingsalert.analytics.data_sdk.beans.ASStoreBn;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASStoreUtil;
import com.kingsalert.kingsalert.analytics.data_sdk.util.ASUtil;

public class ASStoeIfo {

    public static ASStoreBn getDatas(final Context paramContext) {
        ASStoreBn bean = new ASStoreBn();
        try {
            bean.setContainSd(ASStoreUtil.getContainSD());
            bean.setRamCanUse(ASStoreUtil.getRamCanUse(paramContext));
            bean.setRamTotal(ASStoreUtil.getRamTotal(paramContext));
            bean.setCashCanUse(ASStoreUtil.getCashCanUse(paramContext));
            bean.setCashTotal(ASStoreUtil.getCashTotal(paramContext));
            bean.setExtraSD(ASStoreUtil.getExtraSD(paramContext, 1));
            bean.setInternalTotal(ASStoreUtil.getTotalInternalStoreSize(paramContext));
            bean.setInternalAvailable(ASStoreUtil.getAvailaInternalStoreSize(paramContext));
            bean.setRamDidUsed(ASStoreUtil.getRamDidUsed(paramContext));
            bean.setCashDidUsed(ASStoreUtil.getCashDidUsed(paramContext));
            bean.setSdCardTotal(ASStoreUtil.getSDCardTotal(paramContext));
        } catch (Exception e) {
            e.printStackTrace();
        }
        return bean;
    }

    public static String getZipString(Context paramContext) {
        String zipString = "";
        try {
            ASStoreBn infoBean = getDatas(paramContext);
            String result = new Gson().toJson(infoBean).trim();
            zipString = ASUtil.stringToGZIP(result);
        } catch (Exception e) {
            e.printStackTrace();
        }
        return zipString;
    }

}
